A good answer might be:

Object

Example interface

Here is an example interface definition:

interface MyInterface
{
  public final int aConstant = 32;        // a constant
  public final double pi = 3.14159;       // a constant

  public void methodA( int x );           // a method declaration
  double methodB();                       // a method declaration
}

The constants don't have to be separated from the methods, but doing so makes the interface easier to read. A method in an interface cannot be made private. A method in an interface is public by default. In the example methodB is public even though it does not say so.

QUESTION 3:

interface SomeInterface
{
  public final int x = 32;
  public double y;

  public double addup( );
}

Inspect the interface. Is it correct? Click here for a